Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bacpop-181 CSV export project #78

Merged
merged 2 commits into from
Sep 9, 2024
Merged

Conversation

absternator
Copy link
Contributor

The following PR allows for users to export the project in csv format. The button shown in below screenshot. the csv will have columns filename, (...amr for each antibiotic), cluster.... if there is no cluster the text run for cluster assignment will show.

Testing:

  1. create project and add fasta samples and run. Then click export button and csv should download that looks correct as per columns labelled above.

image

Copy link

codecov bot commented Sep 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.64%. Comparing base (b9b1c55) to head (985258d).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #78      +/-   ##
==========================================
+ Coverage   98.60%   98.64%   +0.03%     
==========================================
  Files          31       32       +1     
  Lines        1793     1841      +48     
  Branches      220      229       +9     
==========================================
+ Hits         1768     1816      +48     
  Misses         24       24              
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@EmmaLRussell EmmaLRussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - couple of tiny potential nitpicks:

  • should maybe be consistent about capitalising the column headers - currently all the drug names are capitalised but cluster and filename are not,
  • I think silently putting "run for cluster assignment" into the file seems a bit strange. I think it would be better to warn user "Cluster values will be blank in exported file, as analysis has not yet run. Export anyway?" - and get them to confirm, then just leave cluster values empty.
  • Commas aren't escaped in the csv generation, so you end up with an extra column in the row if you've got a filename with a comma in it (should wrap these values in double quotes I think). I tried this and found that that sample failed analysis anyway - probably because of a similar issue in the back end! But that showed up another issue with putting "run analysis.." if the cluster is missing, as it shows that for failed samples too, where running won't make a difference. I think having cluster be blank for those samples would be fine too.

@absternator
Copy link
Contributor Author

  • should maybe be consistent about capitalising the column headers - currently all the drug names are capitalised but cluster and filename are not,
  • I think silently putting "run for cluster assignment" into the file seems a bit strange. I think it would be better to warn user "Cluster values will be blank in exported file, as analysis has not yet run. Export anyway?" - and get them to confirm, then just leave cluster values empty.
  • Commas aren't escaped in the csv generation, so you end up with an extra column in the row if you've got a filename with a comma in it (should wrap these values in double quotes I think). I tried this and found that that sample failed analysis anyway - probably because of a similar issue in the back end! But that showed up another issue with putting "run analysis.." if the cluster is missing, as it shows that for failed samples too, where running won't make a difference. I think having cluster be blank for those samples would be fine too.
  1. agreed done
  2. I can't entirely agree with this as users that use beebop know whats going on. so if they export without cluster assignment that should be fine... putting a dialog may be annoying and seems like its a bad thing they are doing (when its entirely valid).
  3. Good catches !!!! have done.. and just made cluster column blank if not present

@EmmaLRussell
Copy link
Collaborator

EmmaLRussell commented Sep 9, 2024

I can't entirely agree with this as users that use beebop know whats going on. so if they export without cluster assignment that should be fine... putting a dialog may be annoying and seems like its a bad thing they are doing (when its entirely valid).

I see what you mean, but it just seems weird to pollute output data with a user instruction, especially if we're assuming that they know what they're doing... Could include 'don't warn again' in the dialog, or could pop up some non-intrusive toast saying "Exported without cluster values (run analysis to include next time)" or something like that.

and just made cluster column blank if not present

oh, ok!

@EmmaLRussell
Copy link
Collaborator

EmmaLRussell commented Sep 9, 2024

users that use beebop know whats going on

Dangerous assumption! 😆

@absternator
Copy link
Contributor Author

I see what you mean, but it just seems weird to pollute output data with a user instruction, especially if we're assuming that they know what they're doing... Could include 'don't warn again' in the dialog, or could pop up some non-intrusive toast saying "Exported without cluster values (run analysis to include next time)" or something like that.

yup agree there shouldn't be a weird user instruction in output, thus have made it empty if not present

Copy link
Collaborator

@EmmaLRussell EmmaLRussell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@absternator absternator merged commit 9abce01 into main Sep 9, 2024
11 checks passed
@absternator absternator deleted the bacpop-181-download-project branch September 9, 2024 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants